<?php
class Header extends CWidget
{
	public function run()
	{ 
		$items = array(
			array('label'=>Yii::t('zii','home'), 'url'=>array('/site/index'))
		);
		foreach(Type::model()->findAll() as $type)
			$items[] = array(
				'label'=>$type->name,
				'url'=>Yii::app()->createUrl('fashion/category',array(
					'id'=>$type->id,
					'type'=>urlencode(str_replace(' ','_',$type->name))
				))
			);
			
		array_push($items,
			array('label'=>Yii::t('labels','SERVICE'), 'url'=>array('/site/page','view'=>'service')),
			array('label'=>Yii::t('labels','CONTACT'), 'url'=>array('/site/contact'))
		);
		$this->render('header',array('items'=>$items));
	}
}